<%@page contentType="text/html; charset=utf-8"%>
<%@ include file="../inc/TagLibs.jsp"%>
<c:set var="pageTitle" value="费用明细一览表" />
<%@ include file="../inc/Title.jsp"%>
<head>
<link href="/css/Query.css" rel="stylesheet" type="text/css">
<link href="/calendar/dhtmlgoodies_calendar/dhtmlgoodies_calendar.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" href="/css/BillList.css" />
<script src="/js/QueryList.js"></script>
<script src="/js/popup_ext.js"></script>
<script src="/calendar/dhtmlgoodies_calendar/dhtmlgoodies_calendar.js"></script>
<script language="javascript">
	function doShow(id){
		var url="/finance/FeeBillEdit.ihtm?id="+id;
		ShowIframe("费用单",url,1024,460,"refreshWin()",1024,600);
	}
	function refreshWin(){
		if(popRetVal!=null){
			window.location.reload(true);
		}
	}
	function doPrint(id){
		showWin(900,370,"/finance/FeeBillPrint.ihtm?id="+id);
	}
	function checkDateStr(){
		var startDate=document.getElementById("start_date").value;
		if(startDate==null || startDate==''){
			ShowAlert('提示框','请选择开始日期',200,100);
			return false;
		}else{
			var arr=startDate.split("-");
			if(arr.length==null || arr.length!=3){
				ShowAlert('提示框','开始日期格式不正确',200,100);
				return false;
			}else if(isNaN(arr[0]) || isNaN(arr[1]) || isNaN(arr[2])){
				ShowAlert('提示框','开始日期格式不正确',200,100);
				return false;
			}
		}
		var endDate=document.getElementById("end_date").value;
		if(endDate==null || endDate==''){
			ShowAlert('提示框','请选择结束日期',200,100);
			return false;
		}else{
			var arr=endDate.split("-");
			if(arr.length==null || arr.length!=3){
				ShowAlert('提示框','结束日期格式不正确',200,100);
				return false;
			}else if(isNaN(arr[0]) || isNaN(arr[1]) || isNaN(arr[2])){
				ShowAlert('提示框','结束日期格式不正确',200,100);
				return false;
			}
		}
		return true;
	}
	function createPageParaStr(){
		var str="start_date="+encodeURIComponent(document.getElementById("start_date").value);
		str=str+"&end_date="+encodeURIComponent(document.getElementById("end_date").value);
		
		var examined="A";
		if(document.getElementById("examine1").checked){
			examined="Y";
		}else if(document.getElementById("examine2").checked){
			examined="N";
		}
		str=str+"&examined="+examined;
		
		str=str+"&manager_name="+encodeURIComponent(document.getElementById("manager_name").value);
		str=str+"&creater_name="+encodeURIComponent(document.getElementById("creater_name").value);
		str=str+"&department="+document.getElementById("department").value;
		str=str+"&fee_type="+document.getElementById("fee_type").value;
		str=str+"&bank_account="+document.getElementById("bank_account").value;
		str=str+"&bill_code="+encodeURIComponent(document.getElementById("bill_code").value);
		str=str+"&rec_name="+encodeURIComponent(document.getElementById("rec_name").value);
		str=str+"&mark="+encodeURIComponent(document.getElementById("mark").value);
		str=str+"&cont="+encodeURIComponent(document.getElementById("cont").value);
		str=str+"&bb_code="+encodeURIComponent(document.getElementById("bb_code").value);
		str=str+"&min_cost="+encodeURIComponent(document.getElementById("min_cost").value.trim());
		str=str+"&max_cost="+encodeURIComponent(document.getElementById("max_cost").value.trim());
		str=str+"&ts_id="+document.getElementById("ts_id").value;
		str=str+"&order_by="+document.getElementById("order_by").value;
		str=str+"&order_sc="+document.getElementById("order_sc").value;
		
		return str;
	}
	
	function createProgramParaStr(){
		var str="start_date="+encodeURIComponent(document.getElementById("hid_start_date").value);
		str=str+"&end_date="+encodeURIComponent(document.getElementById("hid_end_date").value);
		str=str+"&examined=${examined}";
		str=str+"&manager_name="+encodeURIComponent(document.getElementById("hid_manager_name").value);
		str=str+"&creater_name="+encodeURIComponent(document.getElementById("hid_creater_name").value);
		str=str+"&department=${department}";
		str=str+"&fee_type=${feeType}";
		str=str+"&bank_account=${bankAccount}";
		str=str+"&bill_code="+encodeURIComponent(document.getElementById("hid_bill_code").value);
		str=str+"&rec_name="+encodeURIComponent(document.getElementById("hid_rec_name").value);
		str=str+"&mark="+encodeURIComponent(document.getElementById("hid_mark").value);
		str=str+"&cont="+encodeURIComponent(document.getElementById("hid_cont").value);
		str=str+"&bb_code="+encodeURIComponent(document.getElementById("hid_bb_code").value);
		str=str+"&min_cost="+encodeURIComponent(document.getElementById("hid_min_cost").value);
		str=str+"&max_cost="+encodeURIComponent(document.getElementById("hid_max_cost").value);
		str=str+"&ts_id=${tsId}";
		str=str+"&order_by=${orderBy}";
		str=str+"&order_sc=${orderSc}";
		
		return str;
	}
	function doSearch(){
		var str;
		if(IsAdvSearch){//高级
			str="search_type=1";
			if(document.getElementById("cb_fee_date").checked){
				if(checkDateStr()){
					str=str+"&cb_fee_date=1";
				}else{
					return;
				}
			}
			if(document.getElementById("cb_examine").checked){
				str=str+"&cb_examine=1";
			}
			if(document.getElementById("cb_manager").checked){
				var managerName=document.getElementById("manager_name").value.trim();
				if(managerName==null || managerName==""){
					ShowAlert('提示框','请输入经办人姓名',200,100);
					return;
				}
				str=str+"&cb_manager=1";
			}
			if(document.getElementById("cb_creater").checked){
				var createrName=document.getElementById("creater_name").value.trim();
				if(createrName==null || createrName==""){
					ShowAlert('提示框','请输入开单人姓名',200,100);
					return;
				}
				str=str+"&cb_creater=1";
			}
			if(document.getElementById("cb_dep").checked){
				var department=document.getElementById("department").value;
				if(department==null || department=="" || department=="0"){
					ShowAlert('提示框','请选择部门',200,100);
					return;
				}
				str=str+"&cb_dep=1";
			}
			if(document.getElementById("cb_fee_type").checked){
				var feeType=document.getElementById("fee_type").value;
				if(feeType==null || feeType=="" || feeType=="0"){
					ShowAlert('提示框','请选择费用类型',200,100);
					return;
				}
				str=str+"&cb_fee_type=1";
			}
			if(document.getElementById("cb_ban").checked){
				var bankAccount=document.getElementById("bank_account").value;
				if(bankAccount==null || bankAccount=="" || bankAccount=="0"){
					ShowAlert('提示框','请选择银行账户',200,100);
					return;
				}
				str=str+"&cb_ban=1";
			}
			if(document.getElementById("cb_bill_code").checked){
				var billCode=document.getElementById("bill_code").value.trim();
				if(billCode==null || billCode==""){
					ShowAlert('提示框','请输入单号',200,100);
					return;
				}
				str=str+"&cb_bill_code=1";
			}
			if(document.getElementById("cb_rec").checked){
				var recName=document.getElementById("rec_name").value.trim();
				if(recName==null || recName==""){
					ShowAlert('提示框','请输入收款单位',200,100);
					return;
				}
				str=str+"&cb_rec=1";
			}
			if(document.getElementById("cb_mark").checked){
				var mark=document.getElementById("mark").value.trim();
				if(mark==null || mark==""){
					ShowAlert('提示框','请输入备注',200,100);
					return;
				}
				str=str+"&cb_mark=1";
			}
			if(document.getElementById("cb_cont").checked){
				var cont=document.getElementById("cont").value.trim();
				if(cont==null || cont==""){
					ShowAlert('提示框','请输入摘要',200,100);
					return;
				}
				str=str+"&cb_cont=1";
			}
			if(document.getElementById("cb_bb_code").checked){
				var bbCode=document.getElementById("bb_code").value.trim();
				if(bbCode==null || bbCode==""){
					ShowAlert('提示框','请输入业务单号',200,100);
					return;
				}
				str=str+"&cb_bb_code=1";
			}
			if(document.getElementById("cb_cost").checked){
				var minCost=document.getElementById("min_cost").value.trim();
				if(minCost==null || minCost==""){
					ShowAlert('提示框','请输入最小金额',200,100);
					return;
				}else if(isNaN(minCost)){
					ShowAlert('提示框','最小金额只能是数字',200,100);
					return;
				}
				var maxCost=document.getElementById("max_cost").value.trim();
				if(maxCost==null || maxCost==""){
					ShowAlert('提示框','请输入最大金额',200,100);
					return;
				}else if(isNaN(maxCost)){
					ShowAlert('提示框','最大金额只能是数字',200,100);
					return;
				}
				str=str+"&cb_cost=1";
			}
			if(document.getElementById("cb_ts").checked){
				var tsId=document.getElementById("ts_id").value;
				if(tsId==null || tsId=="" || tsId=="0"){
					ShowAlert('提示框','请选择帐套',200,100);
					return;
				}
				str=str+"&cb_ts=1";
			}
			if(document.getElementById("cb_order").checked){
				var orderBy=document.getElementById("order_by").value;
				if(orderBy==null || orderBy==""){
					ShowAlert('提示框','请选择排序类型',200,100);
					return;
				}
				str=str+"&cb_order=1";
			}
		}else{//快速
			str="search_type=2";
			if(!checkDateStr()){
				return;
			}
		}
		var paraStr=createPageParaStr();
		if(paraStr!=""){
			str=str+"&"+paraStr;
		}
		window.location="/finance/FeeBillItemSearchResult.ihtm?"+str;
	}
	function doGo(pageIndex){
		var str=getSearchCondition();
		str=str+"&current_page="+pageIndex;
		window.location="/finance/FeeBillItemSearchResult.ihtm?"+str;
	}
	
	function getSearchCondition(){
		var searchType="${searchType}";
		var str="search_type="+searchType;
		if(searchType=="1"){//高级
			<c:if test="${cbFeeDate=='1'}">str=str+"&cb_fee_date=1";</c:if>
			<c:if test="${cbExamine=='1'}">str=str+"&cb_examine=1";</c:if>
			<c:if test="${cbManager=='1'}">str=str+"&cb_manager=1";</c:if>
			<c:if test="${cbCreater=='1'}">str=str+"&cb_creater=1";</c:if>
			<c:if test="${cbDep=='1'}">str=str+"&cb_dep=1";</c:if>
			<c:if test="${cbFeeType=='1'}">str=str+"&cb_fee_type=1";</c:if>
			<c:if test="${cbBillCode=='1'}">str=str+"&cb_bill_code=1";</c:if>
			<c:if test="${cbRec=='1'}">str=str+"&cb_rec=1";</c:if>
			<c:if test="${cbMark=='1'}">str=str+"&cb_mark=1";</c:if>
			<c:if test="${cbCont=='1'}">str=str+"&cb_cont=1";</c:if>
			<c:if test="${cbBbCode=='1'}">str=str+"&cb_bb_code=1";</c:if>
			<c:if test="${cbBan=='1'}">str=str+"&cb_ban=1";</c:if>
			<c:if test="${cbCost=='1'}">str=str+"&cb_cost=1";</c:if>
			<c:if test="${cbTs=='1'}">str=str+"&cb_ts=1";</c:if>
			<c:if test="${cbOrder=='1'}">str=str+"&cb_order=1";</c:if>
		}else{//快速
			
		}
		var paraStr=createProgramParaStr();
		if(paraStr!=""){
			str=str+"&"+paraStr;
		}
		return str;
	}
	function doJump(pageIndex){
		if(window.event.keyCode==13){
			doGo(pageIndex);
		}
	}
	function DoubleClick(it){
		var ob_arr = document.getElementsByName("query_checkbox");
		var id="";
		if(ob_arr.length>=it.getAttribute("index")){
			id=ob_arr[it.getAttribute("index")-1].value;
		}
		if(id==""){
			return;
		}
		doShow(id);
	}
	function doDownload(){
		var str=getSearchCondition();
		window.location="/finance/FeeBillItemSearchResult.ihtm?content_type=EXCEL&"+str;
	}
	function doCancel(){
		window.close();
	}
	function doInit(){
		Window_Onload();
	}
	function checkInput(){
		if(window.event.keyCode==13){
			doSearch();
		}
	}
	function doAutoCheck(objId){
		document.getElementById(objId).checked=true;
	}
	function selectStafferName(objId,checkObjId){
		var url="/base/StafferMainForSelect.ihtm";
		var cb="selectStafferNameCallBack('"+objId+"','"+checkObjId+"')";
		ShowIframe("选择员工",url,800,500,cb);
	}
	function selectStafferNameCallBack(objId,checkObjId){
		if(popRetVal!=null){
			var arr=popRetVal.split(";");
			document.getElementById(objId).value=arr[1];
			doAutoCheck(checkObjId);
		}
	}
	function setDate(type){
		var d=new Date();
		var startStr="";
		var endStr="";
		if(type=="CURRENT_MONTH"){
			startStr=d.getFullYear()+"-"+(d.getMonth()+1)+"-01";
			endStr=d.getFullYear()+"-"+(d.getMonth()+1)+"-"+d.getDate();
		}else if(type=="PREVIEW_MONTH"){
			d=new Date(d.getFullYear(),d.getMonth(),1);
			d.setDate(d.getDate()-1);
			startStr=d.getFullYear()+"-"+(d.getMonth()+1)+"-1";
			endStr=d.getFullYear()+"-"+(d.getMonth()+1)+"-"+d.getDate();
		}else if(type=="TODAY"){
			startStr=d.getFullYear()+"-"+(d.getMonth()+1)+"-"+d.getDate();
			endStr=d.getFullYear()+"-"+(d.getMonth()+1)+"-"+d.getDate();
		}else if(type=="YESTERDAY"){
			d.setDate(d.getDate()-1);
			startStr=d.getFullYear()+"-"+(d.getMonth()+1)+"-"+d.getDate();
			endStr=d.getFullYear()+"-"+(d.getMonth()+1)+"-"+d.getDate();
		}
		document.getElementById("start_date").value=startStr;
		document.getElementById("end_date").value=endStr;
		doAutoCheck("cb_fee_date");
	}
</script>
</head>
<body oncontextmenu="return false">
<div class="Wrap"><!-- 页面主框架 -->
    
	<div id="ListContainer" class="Container"><!-- 主体容器 -->
	    
	    <!-- 标题栏 -->
	    <div class="Heading BillIcon">
	        <div class="HeadingContent">
	            <h1>费用明细一览表</h1>
	            <span class="Note">查询当期发生的费用明细项目</span>
	        </div>
	    </div>
	
		<!-- 主内容 -->
		<div class="Content">
	        <!-- 筛选控件栏 -->
	        <div class="FilterBar ClearFix">
	            <div class="SearchIcon"></div>
	            <span class="fl">
	            	<table class="MoreOption" cellpadding="0" cellspacing="0">
	            		<th class="c1" width="80px">
	            			<input type="checkbox" name="cb_fee_date" id="cb_fee_date" <c:if test="${cbFeeDate=='1' || searchType=='2'}">checked="true"</c:if> style="visibility:hidden;" />
	            			日期
	            		</th>
	            		<td width="360px">
	            			<input type="text" class="TextBox Datetime" maxlength="15" onKeyUp="checkInput();" onFocus="doAutoCheck('cb_fee_date');" id="start_date" name="start_date" value="<c:out value="${startDate}" />">
			            	<img src="/images/calendar.gif" class="imgIconButton" onClick="displayCalendar(document.getElementById('start_date'),'yyyy-mm-dd',this,false,'doAutoCheck(\'cb_fee_date\')');">
			            	<input type="hidden" id="hid_start_date" value="<c:out value="${startDate}" />">
			            	至
			            	<input type="text" class="TextBox Datetime" maxlength="15" onKeyUp="checkInput();" onFocus="doAutoCheck('cb_fee_date');" id="end_date" name="end_date" value="<c:out value="${endDate}" />">
			            	<img src="/images/calendar.gif" class="imgIconButton" onClick="displayCalendar(document.getElementById('end_date'),'yyyy-mm-dd',this,false,'doAutoCheck(\'cb_fee_date\')');">
			            	<input type="hidden" id="hid_end_date" value="<c:out value="${endDate}" />">
			            	<a href="javascript:setDate('CURRENT_MONTH');">本月</a>
							<a href="javascript:setDate('TODAY');">今天</a>
							<a href="javascript:setDate('YESTERDAY');">昨天</a>
							<a href="javascript:setDate('PREVIEW_MONTH');">上月</a>
	            		</td>
	            	</table>
	            </span>
	            <span class="fr">
	            	<a href="javascript:;" id="lnkMoreOption">更多查询选项</a>
		  			<input type="button" value=" 查 询" onClick="doSearch();" class="buttom search-but" id="sSearchButton" name="sSearchButton">
		  			<input type="button" value=" 导 出" onClick="doDownload();" class="buttom search-out" id="sDownloadButton" name="sDownloadButton" <c:if test="${currentUser.user.userType!=1 && fn:indexOf(currentUser.privs,';NO_EXPO;')!=-1}">disabled="true"</c:if>>
	            </span>
				<div id="dvMoreOptionBox" class="MoreOptionBox" style="display:none;">
					<table class="MoreOption" cellpadding="0" cellspacing="0">
						<tr>
							<th class="c1" width="80px">
			        			<input type="checkbox" name="cb_rec" id="cb_rec" <c:if test="${cbRec=='1'}">checked="true"</c:if>>
			        			收款单位
			        		</th>
			        		<td class="c1" width="260px">
			        			<input type="text" class="TextBox" maxlength="50" name="rec_name" id="rec_name" onKeyUp="checkInput();" onFocus="doAutoCheck('cb_rec');" value="<c:out value="${recName}" />" >
								<input type="hidden" id="hid_rec_name" value="<c:out value="${recName}" />">
			    			</td>
			    			<th class="c2" width="80px">
	                        	<input type="checkbox" name="cb_examine" id="cb_examine" <c:if test="${cbExamine=='1'}">checked="true"</c:if>>
	                        	审核状态
	                        </th>
	                    	<td class="c2" width="250px">
	                        	<input type="radio" name="examined" id="examine1" onClick="doAutoCheck('cb_examine');" <c:if test="${examined==null || examined=='' || examined=='Y'}">checked="true"</c:if>>已审核
								<input type="radio" name="examined" id="examine2" onClick="doAutoCheck('cb_examine');" <c:if test="${examined=='N'}">checked="true"</c:if>>未审核
								<input type="radio" name="examined" id="examine3" onClick="doAutoCheck('cb_examine');" <c:if test="${examined=='A'}">checked="true"</c:if>>全部
	                    	</td>
			    		</tr>
						<tr>
							<th class="c1">
			        			<input type="checkbox" name="cb_bill_code" id="cb_bill_code" <c:if test="${cbBillCode=='1'}">checked="true"</c:if>>
			        			单号
			        		</th>
			        		<td class="c1">
			        			<input type="text" class="TextBox" maxlength="50" name="bill_code" id="bill_code" onKeyUp="checkInput();" onFocus="doAutoCheck('cb_bill_code');" value="<c:out value="${billCode}" />" >
								<input type="hidden" id="hid_bill_code" value="<c:out value="${billCode}" />">
			    			</td>
			    			<th class="c2">
			        			<input type="checkbox" name="cb_fee_type" id="cb_fee_type" <c:if test="${cbFeeType=='1'}">checked="true"</c:if>>
			        			费用类型
			        		</th>
			    			<td class="c3">
			        			<select name="fee_type" id="fee_type" onFocus="doAutoCheck('cb_fee_type');">
					  				<option value="0">==请选择==</option>
					  				<c:forEach var="item" items="${ftList}">
					  				<c:if test="${item.enabled=='Y'}"><option value="${item.id}" <c:if test="${feeType==item.id}">selected</c:if>>${item.typeName}</option></c:if>
					  				</c:forEach>
				  				</select>
			    			</td>
			    		</tr>
			    		<tr>
							<th class="c1">
			        			<input type="checkbox" name="cb_mark" id="cb_mark" <c:if test="${cbMark=='1'}">checked="true"</c:if>>
			        			备注
			        		</th>
			        		<td class="c1">
			        			<input type="text" class="TextBox" maxlength="50" name="mark" id="mark" onKeyUp="checkInput();" onFocus="doAutoCheck('cb_mark');" value="<c:out value="${mark}" />" >
								<input type="hidden" id="hid_mark" value="<c:out value="${mark}" />">
			    			</td>
			    			<th class="c2">
			        			<input type="checkbox" name="cb_ban" id="cb_ban" <c:if test="${cbBan=='1'}">checked="true"</c:if>>
			        			银行账户
			        		</th>
			    			<td class="c3">
			        			<select name="bank_account" id="bank_account" onFocus="doAutoCheck('cb_ban');">
					  				<option value="0">==请选择==</option>
					  				<c:forEach var="item" items="${myBaList}">
					  				<option value="${item.id}" <c:if test="${bankAccount==item.id}">selected</c:if>>${item.bankName}<c:if test="${item.accountName!=null && item.accountName!=''}">(${item.accountName})</c:if></option>
					  				</c:forEach>
				  				</select>
			    			</td>
			    		</tr>
			    		<tr>
			    			<th class="c1">
			        			<input type="checkbox" name="cb_cont" id="cb_cont" <c:if test="${cbCont=='1'}">checked="true"</c:if>>
			        			摘要
			        		</th>
			        		<td class="c1">
			        			<input type="text" class="TextBox" maxlength="50" name="cont" id="cont" onKeyUp="checkInput();" onFocus="doAutoCheck('cb_cont');" value="<c:out value="${cont}" />" >
								<input type="hidden" id="hid_cont" value="<c:out value="${cont}" />">
			    			</td>
			    			<th class="c2">
			        			<input type="checkbox" name="cb_manager" id="cb_manager" <c:if test="${cbManager=='1'}">checked="true"</c:if>>
			        			经办人
			        		</th>
			        		<td class="c3">
			        			<input type="text" class="TextBox" maxlength="15" name="manager_name" id="manager_name" onKeyUp="checkInput();" onFocus="doAutoCheck('cb_manager');" value="<c:out value="${managerName}" />">
								<img class="imgIconButton" src="/images/make-a.gif" onClick="selectStafferName('manager_name','cb_manager');" />
								<input type="hidden" id="hid_manager_name" value="<c:out value="${managerName}" />">
			    			</td>
			    		</tr>
			    		<tr>
			    			<th class="c1">
			        			<input type="checkbox" name="cb_cost" id="cb_cost" <c:if test="${cbCost=='1'}">checked="true"</c:if>>
			        			金额
			        		</th>
			    			<td>
			        			<input type="text" class="TextBox Money" maxlength="15" onKeyUp="checkInput();" onFocus="doAutoCheck('cb_cost');" id="min_cost" name="min_cost" value="${minCost}">
								至
								<input type="text" class="TextBox Money" maxlength="15" onKeyUp="checkInput();" onFocus="doAutoCheck('cb_cost');" id="max_cost" name="max_cost" value="${maxCost}">
								<input type="hidden" id="hid_min_cost" value="<c:out value="${minCost}" />">
								<input type="hidden" id="hid_max_cost" value="<c:out value="${maxCost}" />">
			    			</td>
			    			<th class="c2">
			        			<input type="checkbox" name="cb_creater" id="cb_creater" <c:if test="${cbCreater=='1'}">checked="true"</c:if>>
			        			开单人
			        		</th>
			        		<td class="c3">
			        			<input type="text" class="TextBox" maxlength="15" name="creater_name" id="creater_name" onKeyUp="checkInput();" onFocus="doAutoCheck('cb_creater');" value="<c:out value="${createrName}" />">
								<img class="imgIconButton" src="/images/make-a.gif" onClick="selectStafferName('creater_name','cb_creater');" style="cursor:pointer;" />
								<input type="hidden" id="hid_creater_name" value="<c:out value="${createrName}" />">
			    			</td>
			    		</tr>
			    		<tr>
			    			<th class="c1">
			        			<input type="checkbox" name="cb_bb_code" id="cb_bb_code" <c:if test="${cbBbCode=='1'}">checked="true"</c:if>>
			        			业务单号
			        		</th>
			        		<td class="c1">
			        			<input type="text" class="TextBox" maxlength="50" name="bb_code" id="bb_code" onKeyUp="checkInput();" onFocus="doAutoCheck('cb_bb_code');" value="<c:out value="${bbCode}" />" >
								<input type="hidden" id="hid_bb_code" value="<c:out value="${bbCode}" />">
			    			</td>
			        		<th class="c2">
			        			<input type="checkbox" name="cb_dep" id="cb_dep" <c:if test="${cbDep=='1'}">checked="true"</c:if>>
			        			部门
			        		</th>
			    			<td class="c3">
			        			<select name="department" id="department" onFocus="doAutoCheck('cb_dep');">
					  				<option value="0">==请选择==</option>
					  				<commonTag:createSelectTree list="${depList}" emptyOption="0" defaultValue="${department}" />
				  				</select>
			    			</td>
			    		</tr>
			    		<tr>
			    			<th class="c1">
			        			<input type="checkbox" name="cb_ts" id="cb_ts" <c:if test="${cbTs=='1'}">checked="true"</c:if>>
	                        	账套
			        		</th>
			    			<td class="c1">
			        			<select name="ts_id" id="ts_id" onFocus="doAutoCheck('cb_ts');">
				    				<option value="0">==请选择账套==</option>
				    				<c:forEach var="item" items="${tsList}">
									<option value="${item.id}" <c:if test="${tsId==item.id}">selected</c:if>>${item.title}</option></c:forEach>
								</select>
			        		</td>
			        		<th class="c2">&nbsp;</th>
			    			<td class="c3">&nbsp;</td>
			    		</tr>
			    	</table>
			    	
			    	<div class="OptionOrderBy">
	                	<input type="checkbox" name="cb_order" id="cb_order" <c:if test="${cbOrder=='1'}">checked="true"</c:if>>
	                    	排序类型
	                    <select name="order_by" id="order_by" onFocus="doAutoCheck('cb_order');">
	                        <option value="">==请选择==</option>
					  		<option value="FEE_DATE" <c:if test="${orderBy=='FEE_DATE'}">selected</c:if>>日期</option>
					  		<option value="COST" <c:if test="${orderBy=='COST'}">selected</c:if>>金额</option>
					  		<option value="FEE_TYPE" <c:if test="${orderBy=='FEE_TYPE'}">selected</c:if>>费用类型</option>
	                    </select>
	                    <select name="order_sc" id="order_sc" onFocus="doAutoCheck('cb_order');">
	                        <option value="ASC" <c:if test="${orderSc=='ASC'}">selected</c:if>>升序</option>
	                        <option value="DESC" <c:if test="${orderSc=='DESC'}">selected</c:if>>降序</option>
	                    </select>
	                    <span class="fr"><a href="javascript:;" id="lnkHiddenOption">隐藏查询选项</a></span>
	                </div>
				</div>
			</div>
			
			<!-- 提示信息显示栏 -->
	        <div class="MsgBar">
	            <%@include file="../inc/AlertMsg.jsp"%>
	        </div>
	        
	        <!-- 上栏 分页、操作等 -->
			<c:if test="${currentUser.user.userType==1 || fn:indexOf(currentUser.privs,';NO_TOTA;')==-1}">
	        <div class="TopToolBar">
	            <table class="ListNoteInfo" cellpadding="0" cellspacing="0">
	            	<tr>
	                	<td>金额合计：${feeTotal}元</td>
	            	</tr>
	            </table>
			</div>
			</c:if>

		    <div class="table-list">
		        <table width="100%">
		          	<tr>
						<th width="10%">单号</th>
						<th width="10%">银行账户</th>
						<th width="8%">日期</td>
						<th width="6%">费用类型</th>
						<th width="8%">收款单位</th>
						<th width="6%">金额</th>
						<th width="10%">备注</th>
						<th width="10%">摘要</th>
						<th width="10%">业务单号</th>
						<th width="6%">经办人</th>
						<th width="6%">开单人</th>
						<th width="5%">状态</th>
						<th width="5%">操作</th>
					</tr>
					<c:forEach var="item" items="${qr.list}" varStatus="i">
					<c:if test="${(i.index mod 2)==0}"><c:set var="trClass" value="query_list_data_tr1" /></c:if>
					<c:if test="${(i.index mod 2)!=0}"><c:set var="trClass" value="query_list_data_tr2" /></c:if>
					<c:set var="defaultFontColor" value="black" />
					<c:if test="${item[0].feeBill.examined=='Y'}"><c:set var="defaultFontColor" value="blue" /></c:if>
					<tr class="${trClass}" index="${i.index+1}" style="color:${defaultFontColor};cursor:pointer;" defaultFontColor="${defaultFontColor}" ondblclick='javascript:DoubleClick(this)' onClick='javascript:ClickCheck(this)' onmouseout='javascript:mouseout(this)' onmouseover='javascript:mouseover(this)'>
						<td>
							${item[0].feeBill.billCode}
							<input type="radio" name='query_checkbox' value="${item[0].feeBill.id}" style="display:none">
						</td>
						<td>${item[0].bankAccountName}</td>
						<td><fmt:formatDate value="${item[0].feeBill.feeDate}" pattern="yyyy-MM-dd"/></td>
						<td><commonTag:showSimpleObjectName list="${ftList}" objectId="${item[1].ftId}" /></td>
						<td>${item[0].feeBill.receiverName}</td>
						<td>${item[1].cost}</td>
						<td>${item[1].mark}</td>
						<td>${item[0].feeBill.mark}</td>
						<td>${item[1].bbCode}</td>
						<td>${item[0].feeBill.managerName}</td>
						<td>${item[0].feeBill.createrName}</td>
						<td>
							<c:if test="${item[0].feeBill.examined=='Y'}">已审核</c:if>
							<c:if test="${item[0].feeBill.examined=='N'}">未审核</c:if>
						</td>
						<td>
							<a href="javascript:doShow('${item[0].feeBill.id}');">查看</a>
						</td>
					</tr>
					</c:forEach>
				</table>
			</div>
      		<!-- 底栏 分页、操作等 -->
	        <div class="BottomToolBar ClearFix">
			    <%@include file="../inc/Pages.jsp"%>
	        </div>
			
		</div>
	</div>
</div>
</body>
</html>
<script type="text/javascript">
	function ChangeWindowSize( container, maxWidth ){
	    setTimeout( function(){
	        var w1 = document.documentElement.clientWidth-40;
	        if( w1>maxWidth ) w1 = maxWidth;
	        else if( w1<970 ) w1 = 960;
	        container.style.width = w1+'px';
	    }, 300 );
	}
	var IsAdvSearch = false;
	(function(){
		doInit();
	    var ListContainer = document.getElementById('ListContainer');
	    ChangeWindowSize( ListContainer, 2020 );    // 超过 1280 的最大 1260 ，不全部铺满
	
	    var lnkMoreOption   = document.getElementById('lnkMoreOption');
	    var lnkHiddenOption = document.getElementById('lnkHiddenOption');
	    lnkMoreOption.onclick = function(){
	    	IsAdvSearch = true;
	        document.getElementById('dvMoreOptionBox').style.display = 'block';
	        document.getElementById('cb_fee_date').style.visibility = 'visible';
	        this.style.visibility = 'hidden';
	    };
	    lnkHiddenOption.onclick = function(){
	    	IsAdvSearch = false;
	        document.getElementById('dvMoreOptionBox').style.display = 'none';
	        document.getElementById('cb_fee_date').style.visibility = 'hidden';
	        lnkMoreOption.style.visibility = 'visible';
	    };
	})();
</script>
